<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
return [
    Elasticsearch\Client::class => function () {
        return \Elasticsearch\ClientBuilder::create()
            //->setHosts(['http://192.168.5.217:9200'])
            ->setHosts([env('ES_HOST', 'http://localhost').':9200'])
            ->setRetries(3) // 设置 retries
            ->build();
    },

    Elasticsearch\Transport::class => function () {
        return new \Elasticsearch\Transport(); // 如果有额外的构造函数参数，可以在这里传入
    },
];
